#include "ItemRoot.h"
#include "Defines.h"



ItemRoot::ItemRoot(QObject *parent) :
    ItemGroup(parent)
{
    setData(CategoryData, ItemCategory_Root);

    m_dirty = false;

    connect(this, SIGNAL(sigDirty()), this, SLOT(setDirty()));
}


ItemRoot::ItemRoot(const QString& name, QObject *parent) :
    ItemGroup(parent)
{
    setData(CategoryData, ItemCategory_Root);
    setData(NameData, name);

    m_dirty = false;

    connect(this, SIGNAL(sigDirty()), this, SLOT(setDirty()));
}



void ItemRoot::setFilePath(const QString &file_path)
{
    m_filePath = file_path;
}



QString ItemRoot::filePath() const
{
    return m_filePath;
}

int ItemRoot::fieldCount() const
{
    return (AbstractItem::DataType_LAST - AbstractItem::DataType_FIRST + 1);
}


QString ItemRoot::fieldName(const int &data_type) const
{
    return AbstractItem::fieldName(data_type);
}


int ItemRoot::field(const QString &field_name) const
{
    return AbstractItem::field(field_name);
}

bool ItemRoot::isDirty() const
{
    return m_dirty;
}



void ItemRoot::setDirty(const bool &dirty)
{
    m_dirty = dirty;
}


void ItemRoot::setCustomData(const int &, const QVariant &)
{
}


QVariant ItemRoot::customData(const int &, int) const
{
    return QVariant();
}
